let express = require('express')
let app = express()
let birds = require('./bird')

app.use('/bird', birds)

app.set('view engine', 'jade')
// app.set('port', 3000)

//index page
app.get('/', function(req, res){
  res.render('index', {title: 'imooc', message: 'index'})
})

//detail page
app.get('/movie/:id', function(req, res){
  res.render('detail', {title: 'imooc', message: 'detail'})
})

//list page
app.get('/admin/list', function(req, res){
  res.render('list', {title: 'imooc', message: 'list'})
})

//admin page
app.get('/admin/movie', function(req, res){
  res.render('admin', {title: 'imooc', message: 'admin'})
})

let server = app.listen(3000, () => {
  let host = server.address().address
  let port = server.address().port
  console.log('Example', host, port)
})